<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>baseURL</title>
</head>
<body>
<h1>baseURL</h1>
<div id="baseURL"></div>
<script src="../js/axios.js"></script>
<script>
    //定义基本路径
    axios.defaults.baseURL = 'http://localhost:8090/'
    //定义请求头信息
    axios.defaults.headers.mytoken = '11223344'
    //测试
    axios.get('hello')
        .then(res => {
            document.getElementById("baseURL").innerText = res.data
        })
</script>
</body>
</html>